from selenium.webdriver.common.by import By

from common.Utils import SearchDriver


class Compatible:
    driver = ""
    url = ""
    def __init__(self):
        self.driver = SearchDriver.driver
        self.url = "http://134.175.130.177:8080/"
        self.driver.get(self.url)

    def test_resolution(self,width,height):
        self.driver.set_window_size(width, height)

        search_input = self.driver.find_element(By.CSS_SELECTOR, "body > div > div.search > input[type=text]")
        assert search_input.is_displayed(), f"Search box not visible at {width}x{height}"
        #self.driver.quit()

#test_resolution(1920, 1080)
#test_resolution(1366, 768)
#test_resolution(800, 600)